<template>
  <div class="yanse">
    <div class="product-activity">
      <div
        class="product"
        v-for="(item, index) in jiekou"
        :key="index"
        @click="fun3(item.goods.sid)"
      >
        <img :src="item.goods.pic" />
        <p>{{ item.goods.gname }}</p>
        <div class="zheKou">
          <span>上门</span>
          <span class="tag">折扣</span>
        </div>
        <div class="price">
          <b>{{ item.goods.price1 }}</b
          ><s>{{ item.goods.price2 }}</s>
        </div>
        <div class="joinCard-tag">
          <span class="tag1">万店联名卡</span>
        </div>
        <div class="bottom-part">
          <div class="artisan-item">
            <div class="avatar">
              <img :src="item.shop.pic" />
            </div>
            <div class="nick-name">
              {{ item.shop.pic.sname }}
              <img src="../../../public/img/xing.png" class="star" />
            </div>
            <div class="right-part">
              <span class="action">抢购</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getlink } from "@/api/getapi.js";
export default {
   props:['goods.sid'],
  data() {
    return {
      jiekou:[],
      // arr: [
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      //   {
      //     img: "img/21.webp",
      //     name: "小红书ins同款纯色显白气质亮片美甲",
      //     price: "￥239",
      //     price1: "￥478",
      //     avatar: "img/23.webp",
      //     user: "怡林工作室",
      //   },
      // ],
    };
  },
  methods: {
     fun3(id) {
      console.log(id);
      this.$router.push({path:"/De",query:{dataList:id}});
    },
  },
  mounted() {
    getlink("/api/shop/findMjGoods").then((res) => {
      // console.log(res);
      this.jiekou = res.data;
      // console.log(res.data[0].goods.sid);
      console.log(this.jiekou);
    });
  },
};
</script>

<style scoped>
.product-activity {
  width: 96%;
  height: 8rem;
  background: rgb(238, 238, 238);
  margin: auto;
  border-bottom: 0.3rem solid rgb(238, 238, 238);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.product {
  width: 48%;
  height: 100%;
  background: rgb(255, 255, 255);
      margin-top: 0.3rem;
}
.product img {
  width: 100%;
}
.product p {
  font-size: 0.3rem;
  margin-top: 0.08rem;
}
.zheKou {
  width: 100%;
  height: 0.4rem;
  margin-top: 0.1rem;
  display: flex;
}
.zheKou span {
  display: block;
  width: 0.8rem;
  height: 0.4rem;
  border: 0.01rem solid skyblue;
  text-align: center;
  line-height: 0.4rem;
  margin-right: 0.3rem;
  color: skyblue;
}
.zheKou .tag {
  color: red;
  border: 0.01rem solid red;
}
.price {
  width: 100%;
  height: 0.7rem;
  margin-top: 0.16rem;
}
.price b {
  font-size: 0.4rem;
  color: red;
}
.price s {
  font-size: 0.3rem;
  color: #666;
}
.joinCard-tag {
  width: 100%;
  height: 0.4rem;
}
.tag1 {
  width: 1.5rem;
  background: black;
  color: #ceb7a6;
  display: block;
  font-size: 0.28rem;
  border-radius: 10%;
}
.bottom-part {
  width: 100%;
  height: 1.4rem;
}
.artisan-item {
  width: 100%;
  display: flex;
}
.avatar {
  width: 2.2rem;
}
.avatar img {
  width: 100%;
  border-radius: 50%;
  margin-top: 0.26rem;
}
.nick-name {
  width: 3.2rem;
  height: 1rem;
  font-size: 0.24rem;
  margin-top: 0.4rem;
}
.right-part {
  width: 3rem;
}
.action {
  display: block;
  font-size: 0.32rem;
  margin-left: 0.5rem;
  margin-top: 0.4rem;
  background: red;
  border-radius: 20%;
  text-align: center;
  color: white;
}
</style>
